package com.java.struts.order.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "orderinfo", schema = "isfull")
public class OrderinfoEntity {
    private int oid;
    private int meid;
    private String oderTime;
    private int onumber;
    private String opayment;
    private String onote;
    private int oramadhin;
    private BigDecimal ototal;

    @Id
    @GenericGenerator(name = "orderGeneric",strategy = "increment")
    @GeneratedValue(generator = "orderGeneric")
    @Column(name = "Oid")
    public int getOid() {
        return oid;
    }

    public void setOid(int oid) {
        this.oid = oid;
    }

    @Basic
    @Column(name = "Meid")
    public int getMeid() {
        return meid;
    }

    public void setMeid(int meid) {
        this.meid = meid;
    }

    @Basic
    @Column(name = "OderTIME")
    public String getOderTime() {
        return oderTime;
    }

    public void setOderTime(String oderTime) {
        this.oderTime = oderTime;
    }

    @Basic
    @Column(name = "Onumber")
    public int getOnumber() {
        return onumber;
    }

    public void setOnumber(int onumber) {
        this.onumber = onumber;
    }

    @Basic
    @Column(name = "Opayment")
    public String getOpayment() {
        return opayment;
    }

    public void setOpayment(String opayment) {
        this.opayment = opayment;
    }

    @Basic
    @Column(name = "Onote")
    public String getOnote() {
        return onote;
    }

    public void setOnote(String onote) {
        this.onote = onote;
    }

    @Basic
    @Column(name = "Oramadhin")
    public int getOramadhin() {
        return oramadhin;
    }

    public void setOramadhin(int oramadhin) {
        this.oramadhin = oramadhin;
    }

    @Basic
    @Column(name = "Ototal")
    public BigDecimal getOtotal() {
        return ototal;
    }

    public void setOtotal(BigDecimal ototal) {
        this.ototal = ototal;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderinfoEntity that = (OrderinfoEntity) o;
        return oid == that.oid &&
                meid == that.meid &&
                onumber == that.onumber &&
                oramadhin == that.oramadhin &&
                Objects.equals(oderTime, that.oderTime) &&
                Objects.equals(opayment, that.opayment) &&
                Objects.equals(onote, that.onote) &&
                Objects.equals(ototal, that.ototal);
    }

    @Override
    public int hashCode() {

        return Objects.hash(oid, meid, oderTime, onumber, opayment, onote, oramadhin, ototal);
    }
}
